<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>景点信息</title>
  <link rel="stylesheet" href="../../../yl/index.css" />
  <!-- 布局样式 -->
  <link rel="stylesheet" href="../../../yl/style.css" />
  <link rel="stylesheet" href="../../../style/wangeditor.css">
  <link rel="stylesheet" href="../../../yl/mobile.css" />
  <link rel="stylesheet" href="../../../yl/easyui.css" />
  <link rel="stylesheet" href="../../../yl/icon.css" />
  <style>
    #table tbody tr {
      position: relative;
    }

    .drag .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell {
      border-color: #67C23A;
    }
  </style>
</head>

<body>
  <!-- <div id="app"> -->
  <div class="easyui-navpanel" id="app" v-cloak>
    <header>
      <div class="m-toolbar">
        <div class="m-title">{{action=='Add'?'添加旅游路线':action=='Modify'?'修改旅游路线':''}}</div>
      </div>
    </header>
    <div class="easyui-navpanel panel-body panel-body-nobottom panel-body-noborder" style="height: 3000px"
      id="MainTable" ref="MainTable"
      :data-options="JSON.stringify({ 'TableName': 'tourist_route', 'form': 'dataForm' ,'primary_key':'Tourist_Route_SerialNumber' })">
      <div class="yl-main">
        <div class="table_titel">
          <div class="titel">旅游路线信息</div>
        </div>
        <el-form :model="dataForm" ref="form" :inline-message="true" style="width: 100%">
          <el-descriptions :column="1" size="large" border>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">旅游线路名称</div>
              </template>
              <el-form-item prop="Tourist_Route_Name"
                :rules="[{ required: true, message: '请输入旅游线路名称', trigger: 'blur' }]">
                <el-input v-model="dataForm.Tourist_Route_Name" class="borderless-input" placeholder="请输入旅游线路名称" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">旅游线路类型</div>
              </template>
              <el-form-item prop="Tourist_Route_Type_SerialNumber"
                :rules="[{ required: true, message: '选择旅游线路类型', trigger: 'change' }]">
                <el-select v-model="dataForm.Tourist_Route_Type_SerialNumber" placeholder="请选择旅游线路类型" size="large">
                  <el-option v-for="item in tourist_route_type" :key="item.Tourist_Route_Type_SerialNumber"
                    :label="item.Tourist_Route_Type" :value="item.Tourist_Route_Type_SerialNumber" />
                </el-select>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">封面</div>
              </template>
              <el-form-item prop="Picture_URL">
                <yl-upload v-model="dataForm.Picture_URL"></yl-upload>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">旅游攻略</div>
              </template>
              <el-form-item prop="Main" :rules="[{ required: true, message: '请输入旅游攻略', trigger: 'blur' }]">
                <yl-text-editor v-model="dataForm.Main" placeholder="请输入旅游攻略"></yl-text-editor>
              </el-form-item>
            </el-descriptions-item>
          </el-descriptions>
        </el-form>
        <div id="ChildTable">
          <div class="table_titel">
            <div class="titel">旅游路线</div>
            <div class="operation">
              <el-button :type="drag?'danger':'success'" size="small"
                @click="handledrag()">{{drag?'取消':'排序'}}</el-button>
              <el-button type="primary" size="small" @click="handleAdd('childDataForm')">新增</el-button>
              <el-button type="danger" size="small" @click="handleRemove('childDataForm')">删除</el-button>
            </div>
          </div>
          <el-form :model="{childDataForm:childDataForm.filter(item => item.Row_Status != '1')}" ref="form1"
            :inline-message="true" style="width: 100%">
            <el-descriptions id="table" :class="drag?'drag':''" style="margin: 0 0 10px;"
              :data-options="JSON.stringify({ 'TableName': 'tourist_route_detail', 'form': 'childDataForm', 'ParentTableName': 'tourist_route'})"
              :column="1" size="large" border>
              <el-descriptions-item v-for="(item,index) in childDataForm.filter(item => item.Row_Status != '1')"
                :key="index">
                <template #label>
                  <div class="cell-item">景区名称</div>
                </template>
                <el-form-item :prop="'childDataForm.' + index + '.Scenic_Spot_SerialNumber'">
                  <el-select v-model="item.Scenic_Spot_SerialNumber" placeholder="请选择景区名称" size="large">
                    <el-option
                      v-for="item in scenic_spot.filter(i=>i.Scenic_Spot_SerialNumber==childDataForm[index].Scenic_Spot_SerialNumber||!childDataForm.filter(item => item.Row_Status != '1').some(x=>i.Scenic_Spot_SerialNumber==x.Scenic_Spot_SerialNumber))"
                      :key="item.Scenic_Spot_SerialNumber" :label="item.Scenic_Spot_Name"
                      :value="item.Scenic_Spot_SerialNumber" />
                  </el-select>
                </el-form-item>
                <el-icon v-if="drag" style="position: absolute; top: 5px; left: 5px;color: #67C23A;">
                  <Rank />
                </el-icon>
              </el-descriptions-item>
            </el-descriptions>
          </el-form>
        </div>
      </div>
    </div>
    <footer class="botton-ann">
      <el-button @click="goBack">返回</el-button>
      <el-button type="primary" plain @click="handleSubmit" :loading="loading">提交</el-button>
    </footer>
  </div>
</body>
<script src="../../../utils/utils.js"></script>
<script src="../../../config/config.js"></script>
<script src="../../../utils/compressor.js"></script>
<script src="../../../utils/Sortable.min.js"></script>
<script src="../../../utils/wangeditor.js"></script>
<script src="../../../utils/mixins.js"></script>
<script src="../../../yl/vue.js"></script>
<script src="../../../yl/index.js"></script>
<script src="../../../yl/zh-cn.mjs"></script>
<script src="../../../yl/index.iife.min.js"></script>
<script src="../../../yl/jquery.min.js"></script>
<script src="../../../utils/jquery.cookie.js"></script>
<script src="../../../yl/jquery.easyui.min.js"></script>
<script src="../../../yl/jquery.easyui.mobile.js"></script>
<script src="../../../yl/moment.min.js"></script>
<script src="../../../api/request.js"></script>
<script src="./js/add.js"></script>

</html>